package com.cirkana.viewer.data.criteria;

import com.cirkana.data.DataException;

public class IdDataCriteria extends DataCriteria {

	protected IdDataCriteria(String column, Integer id) {
		super(column, OPERATOR_EQUALS, id);
	}

	@Override
	public String getSelection() throws DataException {
		StringBuilder s = new StringBuilder();
		s.append(this.column);
		s.append(" ");
		if (this.value == null)
			throw new DataException();
		else {
			s.append(OPERATOR_EQUALS);
			s.append(" ");
			s.append(this.value.toString());
		}
		return s.toString();
	}

}
